package net.chengp.ms.commons.result;

public class R<T> {

	private R() {
	}

	public static <T> Result<T> ok() {
		return new Result<T>();
	}

	public static <T> Result<T> ok(T data) {
		return new Result<T>(data);
	}

	public static <T> Result<T> error(Integer code, String msg) {
		return new Result<>(code, msg);
	}

	public static <T> Result<T> error(ErrorEnum error) {
		return new Result<T>(error);
	}

	public static <T> Result<T> error(Exception e) {
		return new Result<T>(e);
	}

}
